<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>键盘事件处理</title>
</head>
<body>
<div id="app">
  <input type="text" name="wd" id="wd" v-on:keyup="onkeyup">
  <br>
<!--  <input type="text" name="wd" v-model="content"  v-on:keyup="onkey">-->
  <br>
<!--  <input type="text" name="wd" v-model="content"  v-on:keyup.enter="onkey">-->
  <input type="text" name="wd" v-model="content"  v-on:keyup.ctrl.alt="onkey">
</div>
<script src="../../../../js/vue.global.js"></script>
<script>
    const app = Vue.createApp({
        data(){
            return {
              content:null,
            }
        },
        methods:{
          onkeyup(){
            let element = document.getElementById("wd")
            console.log(element.value);
          },
          onkey(){
            console.log(this.content);
          }
        }
    })

    app.mount("#app")
</script>
</body>
</html>